<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.iss.umservice.bean.ServiceBean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<HTML>
<HEAD>
<TITLE>MKTB15</TITLE>
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="../js/IDEA_body.js"
	type=text/javascript></SCRIPT>
<script src="../js/main.js" language="javascript" type="text/javascript"></script>
<link rel="stylesheet" href="../css/validationEngine.jquery.css"
	type="text/css" />
<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="../js/languages/jquery.validationEngine-zh_CN.js"
	type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" type="text/javascript"	
	src="../My97DatePicker/WdatePicker.js"></script>
<script src="../js/jquery.validationEngine.js" type="text/javascript"
	charset="utf-8"></script>
<%
	ServiceBean serviceBean = (ServiceBean) request
			.getAttribute("serviceBean");
%>

<script>
	jQuery(document).ready(function() {
		jQuery("#mainForm").validationEngine({
			autoHidePrompt : true
		});
	});
	var tabLeftOn = "../images/pic_title_1.jpg";
	var tabRightOn = "../images/pic_title_2.jpg";
	var tabLeftOff = "../images/pic_title_4.jpg";
	var tabRightOff = "../images/pic_title_4.jpg";
	
	function isConfirm(obj)
	{

		if(confirm('是否确认删除？'))
		{
			window.location.href="../servicecreate/delService.html?serviceID="+obj+"&type=${type}";
		}
	}
	
	function queryInfo(obj)
	{
		document.mainForm.action="../servicecreate/queryServiceInfo.html?serviceID="+obj+"&pages=${pages}";
		document.mainForm.submit();
		
	}
	
		function modify(obj)
	{
		document.mainForm.action="../servicecreate/gotoModService.html?serviceID="+obj+"&pages=${pages}";
		document.mainForm.submit();
		
	}
	
</script>

</HEAD>

<body>
	<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
		<TBODY>
			<TR>
				<TD height="100%" bgcolor="#FFFFFF" class=right_bg><iss:blank />
					<table width="100%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="20">&nbsp;</td>
							<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>
								&gt; <a href="#" class="blue_1"><c:if test="${type eq 1}">公共服务</c:if><c:if test="${type eq 2}">共享资源</c:if><c:if test="${userType ne 2}">设定</c:if><c:if test="${userType eq 2} ">申请</c:if></a>&gt;已设定的<c:if
									test="${type eq 1}">服务</c:if><c:if test="${type eq 2}">资源</c:if>列表</td>
						</tr>
					</table>

					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						background="../images/bg_body_title.jpg" class="list_border1">
						<tr>
							<td width="10">&nbsp;</td>
							<td>
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="../images/pic_title_1.jpg" name="imgL1"
											width="8" height="24" id="imgL1">
										</td>
										<td valign="bottom" class="text_12_border" nowrap="nowrap"
											style="cursor: hand;" id="tdTitle1">已设定的<c:if test="${type eq 1}">服务</c:if><c:if test="${type eq 2}">资源</c:if>列表</td>
										<td><img src="../images/pic_title_2.jpg" name="imgR1"
											width="8" height="24" id="imgR1">
										</td>
									</tr>
								</table></td>
						</tr>
					</table>
					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						class="list_border2" id="table4">
						<tr>
							<td align="center" valign="top"><iss:blank />
								<form id="mainForm" name="mainForm" method="post"
									action="../servicecreate/queryServiceList.html">
									<table width="98%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="hidden" name="type" value="${type}">
												<c:if test="${type eq 1}">服务</c:if><c:if test="${type eq 2}">资源</c:if>名称：<input
												name="serviceName" type="text"
												class="validate[custom[noSpecialChar]] INPUT2" height="20"
												value="${serviceBean.serviceName}"
												onChange="javaScript:this.value=$.trim(this.value)">
												<c:if test="${type eq 1}">服务</c:if><c:if test="${type eq 2}">资源</c:if>类别：&nbsp; <select
												name="serviceType" type="text">
													<option value="">请选择</option>
													<c:if test="${type eq 1 }">
														<option value="1"
															<c:if test="${serviceBean.serviceType eq 1}">selected</c:if>>公共技术服务</option>
														<option value="2"
															<c:if test="${serviceBean.serviceType eq 2}">selected</c:if>>法律服务</option>
														<option value="3"
															<c:if test="${serviceBean.serviceType eq 3}">selected</c:if>>投融资服务</option>
														<option value="4"
															<c:if test="${serviceBean.serviceType eq 4}">selected</c:if>>财务服务</option>
														<option value="5"
															<c:if test="${serviceBean.serviceType eq 5}">selected</c:if>>知识产权服务</option>
														<option value="6"
															<c:if test="${serviceBean.serviceType eq 6}">selected</c:if>>人才服务</option>
													</c:if>
													<c:if test="${type eq 2 }">
														<option value="7"
															<c:if test="${serviceBean.serviceType eq 7}">selected</c:if>>办公用房</option>
														<option value="8"
															<c:if test="${serviceBean.serviceType eq 8}">selected</c:if>>会议室</option>
														<option value="9"
															<c:if test="${serviceBean.serviceType eq 9}">selected</c:if>>人才公寓</option>
														<option value="10"
															<c:if test="${serviceBean.serviceType eq 10}">selected</c:if>>交通班车</option>
													</c:if>

											</select>&nbsp; <c:choose>
													<c:when test="${userType eq 1 or userType eq 3}">
                      	状态：&nbsp;
                    <select name="status">
															<option value="">请选择</option>
															<option value="1"
																<%if ("1".equals(serviceBean.getStatus())) {%> selected
																<%}%>>使用</option>
															<option value="2"
																<%if ("2".equals(serviceBean.getStatus())) {%> selected
																<%}%>>暂停</option>
														</select> &nbsp;    
                      </c:when>
												</c:choose> 创建日期：&nbsp; <input name="createDate" type="text"
												class="Wdate" height="20" onclick="WdatePicker()"
												value="${serviceBean.createDate}" readonly> 

												<input
												name="Submit" type="submit" class="button_normal"
												value="查  询"> <c:if
													test="${userType eq 1}">
													<input name="button" type="button" class="button_normal"
														value="新增<c:if test="${type eq 1}">服务</c:if><c:if test="${type eq 2}">资源</c:if>"
														onclick="window.location.href='../servicecreate/gotoCreateService.html?type=${type}'">
												</c:if>
											</td>
										</tr>
									</table>
								</form>
								<TABLE width="98%" border=0 cellPadding=0 cellSpacing=0
									class=list_border>
									<TBODY>
										<TR>
											<TD width=1 class=list_title><IMG height=27
												src="../images/pic_body_1.jpg" width=1>
											</TD>
											<TD class=list_title width="10%"><c:if test="${type eq 1 }">服务名称</c:if>
												<c:if test="${type eq 2 }">资源名称</c:if></TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="10%"><c:if test="${type eq 1 }">服务类别</c:if>
												<c:if test="${type eq 2 }">资源类别</c:if></TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title  width="10%">申请是否需要审批</TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="10%">资费信息</TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="5%">状态</TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="10%">创建日期</TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="40%">备注</TD>
											<TD class=list_title width="2"><IMG height=20
												src="../images/icon_line2.gif" width=2>
											</TD>
											<TD class=list_title width="5%">操作</TD>
											<TD width=1 class=list_title><IMG height=27
												src="../images/pic_body_1.jpg" width=1>
											</TD>
											<c:forEach var="serviceBean2" items="${serviceList}"
												varStatus="status">
												<TR class="list_td_white${(status.index+1)%2}">
													<td>&nbsp;</td>
													<TD class="list_td" align="left">
												 <a href="#" onClick="queryInfo('${serviceBean2.serviceID}')">${serviceBean2.serviceName}</a>
													</TD>
													<TD></TD>
													<TD align="center"><c:choose>
															<c:when test="${serviceBean2.serviceType eq 1}">公共技术服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 2}">法律服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 3}">投融资服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 4}">财务服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 5}">知识产权服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 6}">人才服务</c:when>
															<c:when test="${serviceBean2.serviceType eq 7}">办公用房</c:when>
															<c:when test="${serviceBean2.serviceType eq 8}">会议室</c:when>
															<c:when test="${serviceBean2.serviceType eq 9}">人才公寓</c:when>
															<c:when test="${serviceBean2.serviceType eq 10}">交通班车</c:when>
														</c:choose></TD>
													<TD></TD>
													<TD align="center"><c:choose>
															<c:when test="${serviceBean2.needApproval eq 1}">
                      	是
                      </c:when>
															<c:when test="${serviceBean2.needApproval eq 2}">
                      	否
                      </c:when>
														</c:choose>
													</TD>
													<TD></TD>
													<TD align="left">${serviceBean2.feeInfo}</TD>
													<TD></TD>
													<TD align="center"><c:choose>
															<c:when test="${serviceBean2.status eq 1}">
                      	使用
                      </c:when>
															<c:when test="${serviceBean2.status eq 2}">
                      	暂停
                      </c:when>
														</c:choose></TD>
													<TD></TD>
													<TD align="center">${serviceBean2.createDate}</TD>
													<td>&nbsp;</td>
													<TD align="left">${serviceBean2.description}</TD>
													<td>&nbsp;</td>
													<TD align="center"><c:if
															test="${userType eq 2 and serviceBean2.status eq 1 }">
															<a
																href="../servicecreate/gotoApplyService.html?serviceID=${serviceBean2.serviceID}&type=${type}">申请</a>
																<c:if test="${serviceBean2.serviceType eq 8 }">
															<a href="../servicecreate/queryMeetingApplyInfo.html?serviceID=${serviceBean2.serviceID}&serviceName=${serviceBean2.serviceName}">查看预定</a>
														</c:if>
														<c:if test="${userType eq 3}">
														<a href="../servicecreate/queryMeetingApplyInfo.html?serviceID=${serviceBean2.serviceID}&serviceName=${serviceBean2.serviceName}">查看预定</a>
															</c:if>
														</c:if>  <c:if test="${userType eq 1 }">
															<a
																href="#" onclick="modify('${serviceBean2.serviceID}')">修改</a>&nbsp;
																<a href="#" onClick="isConfirm('${serviceBean2.serviceID}')">删除</a>

														</c:if></TD>
													<td>&nbsp;</td>
												</TR>
											</c:forEach>
									</TBODY>

								</TABLE> <iss:blank /></td>
						</tr>
						<tr>
							<td>

								<table width="98%" height="24" border="0" cellpadding="0"
									cellspacing="0">
									<tr>
										<td align="right" valign="bottom"><iss:navigation
												style="0" />
										</td>
									</tr>
								</table></td>
						</tr>
					</table></TD>
			</TR>
		</TBODY>
	</TABLE>
</body>
</HTML>
